import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import {AjaxService} from './commons/ajax.service';

const appRoutes:Routes = [
  { path:'', redirectTo:'home', pathMatch:'full' },
  { path:'home',component: HomeComponent },
  { path:'sys', loadChildren: 'app/sys/sys.module#SysModule' }
]

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(appRoutes, {useHash: true})
  ],
  providers: [AjaxService],
  bootstrap: [AppComponent]
})
export class AppModule { }
